home *** CD-ROM | disk | FTP | other *** search
- # Sample Z-Script function: bounce
- # button: Bounce
-
- function bounce() {
- #%
- # Often, you send mail and mistype an address or something and it causes
- # a "mailer daemon" to return your mail with an error like "host unknown"
- # or "unknown user". The "bounce" function (below) extracts your original
- # message from the mailer-daemon and allows you to edit it again, if it
- # needs it. Otherwise, you can just send it again.
- #%
- if $(%t) == 0 # a convenient way to see if there are any messages.
- echo No messages.
- return -1
- endif
- # use the message specified ($1), if given. Else, use the "current msg".
- Pipe -p From: $1 "cat > $tmpdir/bnc$$"
- if ! -z $tmpdir/bnc$$
- # mail -u means "send unsigned" so it won't autosign the message
- # this assumes you've already signed it the first time you sent it.
- mail -u -h $tmpdir/bnc$$ # use the tmpfile as a template
- endif
- sh rm $tmpdir/bnc$$
- }
- button -n Bounce bounce
-